// import Login from '../views/Login'
// import Register from '../views/Register'
// import Home from '../views/Home'
// import ProductList from '../views/product/ProductList'
// import CategoryList from '../views/product/CategoryList'
// import UserList from '../views/users/UserList'
// import RoleList from '../views/role/RoleList'
// import Main from '../views/Main'
// import NotFound from '../views/NotFound'
// import ProductDetail from '../views/product/ProductDetail'
// import ProductUpdate from '../views/product/ProductUpdate'

import React from 'react'
import loadable from '../utils/loadable'

const Login=loadable(()=>import("../views/Login"))
const Register=loadable(()=>import("../views/Register"))
const Home=loadable(()=>import("../views/Home"))
const ProductList=loadable(()=>import("../views/product/ProductList"))
const CategoryList=loadable(()=>import("../views/product/CategoryList"))
const UserList=loadable(()=>import("../views/users/UserList"))
const RoleList=loadable(()=>import("../views/role/RoleList"))
const Main=loadable(()=>import("../views/Main"))
const NotFound=loadable(()=>import("../views/NotFound"))
const ProductDetail=loadable(()=>import("../views/product/ProductDetail"))
const ProductUpdate=loadable(()=>import("../views/product/ProductUpdate"))

export default [
    {
        path: '/login',
        element:<Login></Login>
    },
    {
        path:'/register',
        element:<Register></Register>
    },
    {
        path:'/',
        element:<Home></Home>,
        children:[
           {
            index:true,
            element:<Main></Main>
           },
           {
            path:'/home/product/list',
            element:<ProductList></ProductList>
           },
           {
            path:'/home/product/category',
            element:<CategoryList></CategoryList>
           },
           {
            path:'/home/user',
            element:<UserList></UserList>
           },
           {
            path:'/home/role',
            element:<RoleList></RoleList>
           },
           {
            path:'/home/product/detail',
            element:<ProductDetail></ProductDetail>
           },
           {
            path:'/home/product/update/:id',
            element:<ProductUpdate></ProductUpdate>
           }
        ]
    },
    {
        path:'*',
        element:<NotFound></NotFound>
    }
]
